03. Accessing Data With SQL

Extracting the Data

Write a SQL query below

Use the SQL Workspace below to extract data from the temperatures database, then download the results to a CSV. Then you can open it up in a spreadsheet program in order to analyze it.

The Database Schema

There are three tables in the database:

  • city_list - This contains a list of cities and countries in the database. Look through them in order to find the city nearest to you.
  • city_data - This contains the average temperatures for each city by year (ºC).
  • global_data - This contains the average global temperatures by year (ºC).

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: sql-evaluator
  • Opened files (when workspace is loaded): n/a

Note: If the proper tables (city_data, city_list, global_data) do not appear for some reason in the Schema above, you can fix this using the Menu in the lower left of the workspace. Make sure you have first saved any query you have entered, then click on Menu, then choose Reset Data, and type in "Reset Data" as directed. This will definitely bring up the proper schema tables for the temperatures database.